package com.action.customer;

import java.util.*;

import com.db.customer.*;

public class ContentAction {
	private int no;
	private CustomerVO vo = new CustomerVO();
	private List<Customer_replyVO> nblist = new ArrayList<Customer_replyVO>();

	private int boardtype;
	private String content;
	private String id;
	private int rno;

	private CustomerDAO customer;

	public CustomerDAO getCustomer() {
		return customer;
	}

	public void setCustomer(CustomerDAO customer) {
		this.customer = customer;
	}

	public List<Customer_replyVO> getNblist() {
		return nblist;
	}

	public int getRno() {
		return rno;
	}

	public void setRno(int rno) {
		this.rno = rno;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getBoardtype() {
		return boardtype;
	}

	public void setBoardtype(int boardtype) {
		this.boardtype = boardtype;
	}

	public void setNo(int no) {
		this.no = no;
	}

	public CustomerVO getVo() {
		return vo;
	}

	public String execute() throws Exception {

		nblist = customer.customer_replyAllData(no);

		System.out.println("content : " + no);
		customer.customerIncreament(no);
		vo = customer.customerFind(no);
		System.out.println(vo.toString());
		return "success";
	}

	public String reply_insert() throws Exception {

		Customer_replyVO rvo = new Customer_replyVO();
		rvo.setGroupno(no);
		rvo.setId(id);
		rvo.setContent(content);

		customer.customer_replyInsert(rvo);

		nblist = customer.customer_replyAllData(no);

		customer.customerIncreament(no);
		vo = customer.customerFind(no);

		return "success";
	}

	public String reply_delete() throws Exception {

		customer.customer_replyDelete(rno);

		nblist = customer.customer_replyAllData(no);

		vo = customer.customerFind(no);

		return "success";
	}

	public String reply_update() throws Exception {

		Customer_replyVO rvo = new Customer_replyVO();

		rvo.setContent(content);
		rvo.setNo(rno);
		System.out.println("1111111111111111111111111");
		customer.customer_replyUpdate(rvo);

		nblist = customer.customer_replyAllData(no);

		vo = customer.customerFind(no);

		return "success";
	}
}
